<?php
	include("includes/secure.php");
	include("includes/config.php");
	include("includes/class/request.class.php");
	include("includes/class/client.class.php");
	
	$request1 = new Request1();
	$client	  = new Client(); 

	$req_code	= $_GET['req_code'];
	
	$data = $request1->getRequestData($req_code);
	
	$banks			= $request1->bankList();	
	$bankContact	= $request1->bankContactList();
	$users			= $client->userList();
	$property		= $request1->propertyList();
			
	if(isset($_POST['edit']) && $_POST['edit'] == 1)
	{
		$new_data->req_code				= $req_code;
		$new_data->ban_code 			= trim(mysql_real_escape_string($_POST['ban_code']));
		$new_data->baco_code			= trim(mysql_real_escape_string($_POST['baco_code']));
		$new_data->use_code 			= trim(mysql_real_escape_string($_POST['use_code']));
		$new_data->pro_code				= trim(mysql_real_escape_string($_POST['pro_code']));

		
		if(!$request1->updateRequest($new_data))
			echo "<script>alert('The Request was Updated..!!!')</script>";
		else
			echo "<script>alert('It could not update the Request... Sorry..!!!')</script>";	
		
			echo "<script> window.location.href='listRequest.php'</script>";
		
	}


?>